import request from '@/utils/request'

// 获取线路分页详情

export const getlinelist = data => request.post('/transportLine/page', data)

// 新增线路

export const addlinelist = data => request.post('/transportLine', data)

// 删除线路

export const delline = id => request.delete(`/transportLine/${id}`)
// 成本查询

export const configuration = () => request.get('/cost-configuration-manager')
// 成本提交
export const sendconfiguration = (data) => request.post('/cost-configuration-manager', data)

// 获取车次列表
export function getcarlist(id) {
  return request({
    url: '/transportLine/trips',
    params: {
      transportLineId: id
    }
  })
}

// 获取车次详细信息

export const getdetaillist = (id) => request.get(`/transportLine/${id}`)

// 更新车次
export const updatecar = (data) => request.put(`/transportLine/${data.id}`, data)
